package com.xxgc.qinglian.qinglianserver.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xxgc.qinglian.qinglianserver.entity.VoteEntity;
import com.xxgc.qinglian.qinglianserver.mapper.VoteMapper;
import com.xxgc.qinglian.qinglianserver.service.VoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class VoteServiceImpl implements VoteService {

    @Autowired
    private VoteMapper voteMapper;

    @Override
    public List<VoteEntity> getVoteInfos() {
        QueryWrapper<VoteEntity> qw = new QueryWrapper<>();
        return voteMapper.selectList(qw);
    }

    @Override
    public void insert(VoteEntity voteEntity) {
        voteMapper.insert(voteEntity);
    }

    @Override
    public void update(VoteEntity voteEntity) {
        voteMapper.updateById(voteEntity);
    }


}